import React, { Component } from "react";
import { Route, Switch, Redirect } from "react-router-dom";
import MyNavlink from "../../components/MyNavlink/MyNavlink";
import Home_news from "./Home_news/Home_news";
import Home_message from "./Home_message/Home_message";

export default class Home extends Component {
  render() {
    // console.log("Home:", this.props);
    return (
      <div>
        <span>
          <MyNavlink to="/home/news">Home_news</MyNavlink>
        </span>
        <span style={{ marginLeft: "10px" }}>
          <MyNavlink to="/home/message">Home_message</MyNavlink>
        </span>
        <hr></hr>
        <Switch>
          <Route path="/home/news" component={Home_news}></Route>
          <Route path="/home/message" component={Home_message}></Route>

          <Redirect to="/home/news" />
        </Switch>
      </div>
    );
  }
}
